package edu.pku.sei.mte.mtemodel.mtmodel;

import edu.pku.sei.mte.mtemodel.metamodel.RTypeGraph;
import edu.pku.sei.mte.utilities.Visitable;
import edu.pku.sei.mte.utilities.Visitor;

public class ModelType implements Visitable{
	private RTypeGraph typeGraph;
	private String name;
	public RTypeGraph getTypeGraph() {
		return typeGraph;
	}
	public void setTypeGraph(RTypeGraph typeGraph) {
		this.typeGraph = typeGraph;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public Object accept(Visitor visitor) {
		return visitor.visitModelType(this);
	}
	@Override
	public boolean equals(Object arg0) {
		if(arg0 instanceof ModelType){
			if(((ModelType)arg0).name.equals(name))
				return true;
		}
		return false;
	}
	@Override
	public int hashCode() {
		return name.hashCode();
	}

}
